create or replace view vac_application_page_da_4_1 as
with da as
(
 select
 workspace,
 application_id,
 application_name,
 page_id,
 page_name,
 dynamic_action_name,
 to_char(dynamic_action_sequence) dynamic_action_sequence,
 when_element,
 when_selection_type,
 when_region,
 when_region_id,
 when_condition,
 when_expression,
 when_event_scope,
 when_event_internal_name,
 when_event_name,
 condition_type,
 condition_expression1,
 condition_expression2,
 build_option,
 build_option_id,
 authorization_scheme,
 authorization_scheme_id,
 last_updated_on,
 last_updated_by,
 component_comment,
 dynamic_action_id,
 to_char(number_of_actions) number_of_actions
from apex_application_page_da
)
select
 workspace,
 application_id,
 application_name,
 page_id,
 page_name,
 authorization_scheme_id,
 build_option_id,
 when_region_id,
 dynamic_action_id,
 dynamic_action_name,
 last_updated_on,
 last_updated_by,
 'APEX_APPLICATION_PAGE_DA' src_view_name,
 u_name,
 u_value
from da
  UNPIVOT INCLUDE NULLS (
   u_value
   FOR    u_name
   IN
   (
       dynamic_action_sequence,
       when_element,
       when_selection_type,
       when_region,
       when_condition,
       when_expression,
       when_event_scope,
       when_event_internal_name,
       when_event_name,
       condition_type,
       condition_expression1,
       condition_expression2,
       build_option,
       authorization_scheme,
       component_comment,
       number_of_actions
   )
);

